using System;
using System.Linq;
using Bots.DungeonBuddy.Helpers;
using FarmerJoe.ClassSettings;
using FarmerJoe.Helpers;
using FarmerJoe.Helpers.Singular.Helpers;
using FarmerJoe.Helpers.Units;
using FarmerJoe.Settings;
using Styx;
using Styx.CommonBot;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Action = Styx.TreeSharp.Action;

namespace FarmerJoe.Classes
{
    public static partial class Priest
    {

        public static Composite CombatBehavior_Holy(bool moveToTarget)
        {
            //get
            {
                return new PrioritySelector(

                    Spells.WaitForCast(),
                    Misc.EnsureTarget(),

                    // Healing
                    //new Common.NeedToUseLifeSpirit(new Common.UseLifeSpirit()),
                    Common.UseHealthManaRegenAgent(ClassParser.HealthPotion, ClassParser.ManaPotion),
                    
                    AllFormsHeal(),

                    Inventory.UseTrinket1(),
                    Inventory.UseTrinket2(),

                    Movement.MoveToLOS(),
                    Movement.FaceTarget(),


                    Spells.Cast("Shadow Word: Death", ret => CT.HealthPercent < 20),
                    Spells.Cast("Devouring Plague", ret => ShadowOrbCount >= 3),
                    Spells.Cast("Vampiric Touch", ret => CT.AuraTimeLeft("Vampiric Touch") < 3 && Timers.SpellOkToCast("Vampiric Touch", 2000)),
                    Spells.Cast("Power Word: Solace", ret => CT.AuraTimeLeft("Shadow Word: Pain") <= 5),
                    Spells.Cast("Shadow Word: Pain", ret => CT.AuraTimeLeft("Shadow Word: Pain") < 2 && Timers.SpellOkToCast("Shadow Word: Pain", 2000)),
                    Spells.Cast("Mind Blast"),

                    Spells.Cast("Smite"),


                    new Decorator(ret => Me.IsCasting || Me.IsChanneling, new Action(context => RunStatus.Success)),
                    Movement.MoveToTarget(true, 36f)
                    );
            }
        }

        public static Composite PullBehavior_Holy
        {
            get
            {
                return new PrioritySelector(

                    Spells.WaitForCast(),
                    Misc.EnsureTarget(),
                    Movement.MoveToLOS(),

                    // User defined pull options
                    new Decorator(ret => FpswareSettings.Instance.Priest.HolyPull.Contains("user defined"),
                                  new PrioritySelector(
                                      
                                      
                                      )),


                    // Automatic fall through stuff
                    new Decorator(ret => FpswareSettings.Instance.Priest.HolyPull.Contains("automatic"),
                                  new PrioritySelector(



                                      )),


                    new Decorator(ret => Me.IsCasting || Me.IsChanneling, new Action(context => RunStatus.Success)),

                    Movement.MoveToTarget(true, 35f)
                    );
            }
        }
        
    }
}